import { post } from './service-base';

/**
 * 登录
 */
export const doLogin = (data: { mobile: string; password: string }) => {
  return post('/starsports/user/login', data);
};

/**
 * 发送验证码
 */
export const sendCode = (data: { mobile: string; type: string }) => {
  return post('/starsports/user/sendCode', data);
};

/**
 * 注册
 */
export const doRegister = (data: {
  mobile: string;
  password: string;
  smsCode: string;
}) => {
  return post('/starsports/user/register', data);
};

/**
 * 修改密码
 */
export const resetPwd = (data: {
  mobile: string;
  password: string;
  smsCode: string;
}) => {
  return post('/starsports/user/reset', data);
};

/**
 * 查询用户信息
 */
export const queryUserInfo = () => {
  return post('/starsports/user/userInfo', {});
};

/**
 * 退出登录
 */
export const logout = () => {
  return post('/starsports/user/logout', {});
};
